<?php
$uri        = get_base_url() . url_title($product->category, 'dash', TRUE) . '-c' . $product->categories_id . '/' . get_uri_product($product->product_name, $product->id);
$price      = $product->price != 0 ? get_price_in_vnd($product->price) . 'đ' : get_price_in_vnd($product->price);
?>
<h2 class="page-name">
    <?php echo $product->product_name;?>
</h2>
<div class="wrap_content">
    <div class="prod-detail">
        <div class="prod-detail-left left">
            <table class="prod-large-image">
                <tbody>
                    <tr>
                        <td>
                            <?php
                            $thumbnails = '';
                            foreach ($images as $image):
                                $image_name = $image->image_name;
                                if ($image->position == 1):
                                    ?>
                                    <a rel="example_group" href="<?php echo base_url();?>images/products/<?php echo $image_name;?>">
                                        <img src="/images/products/<?php echo $image_name;?>"/>
                                        <input type="hidden" class="firstimg-rel" value="/images/products/<?php echo $image_name;?>">
                                    </a>
                                    <?php
                                else:
                                    $thumbnails .= '
                                    <li>
                                        <table>
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <a rel="example_group" href="' . base_url() . 'images/products/' . $image_name . '">
                                                            <img class="alignleft" src="' . base_url() . 'images/products/thumbnails/' . $image_name . '" alt="">
                                                        </a>
                                                        <input type="hidden" class="otherimg-rel" value="' . base_url() . 'images/products/' . $image_name . '">
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </li>';
                                endif;
                            endforeach;
                            ?>

                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="prod-detail-right right">
            <div class="clear"></div>
            <div class="prod-orther-slide">
                <h5 class="sub-title">Hình sản phẩm</h5>
                <div class="slide">
                    <ul>
                        <?php echo $thumbnails;?>
                    </ul>
                </div>
                <!--                <a href="#" id="btn-next">Next</a>
                                <a href="#" id="btn-prev">Prev</a>-->
            </div>
            <div class="clear"></div>
            <div style="margin-left: 20px;">
                <!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style ">
                    <a class="addthis_button_preferred_1"></a>
                    <a class="addthis_button_preferred_2"></a>
                    <a class="addthis_button_preferred_3"></a>
                    <a class="addthis_button_preferred_4"></a>
                    <a class="addthis_button_compact"></a>
                    <a class="addthis_counter addthis_bubble_style"></a>
                </div>
                <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-51b6dc742b4478e6"></script>
                <!-- AddThis Button END -->
            </div>
            <div class="clear"></div>
            <div style="padding-left: 20px;padding-top: 10px;" class="thongtinlienhe">
                <?php echo modules::run('pages/get_static_page_content', array('uri' => '/thong-tin-lien-he'));?>
            </div>
        </div>
        <div class="left wrap03"></div>
        <div class="clear"></div>
    </div>
    <div class="tab-container">
        <div class="tab-nav tab-detail">
            <ul>
                <li class="active" style="z-index: 3;">
                    <a href="#tabs1">
                        <span style="padding-left: 8px;">Thông số kỹ thuật </span>
                    </a>
                </li>
                <li style="z-index: 2;">
                    <a href="#tabs2">
                        <span style="padding-left: 8px;"> Mô tả chi tiết </span>
                    </a>
                </li>
                <li style="z-index: 1;">
                    <a href="#tabs3">
                        <span style="padding-left: 8px;"> Sản phẩm cùng loại </span>
                    </a>
                </li>
            </ul>
            <div class="clear">
            </div>
        </div>        
        <div class="tab-contents">          
            <div class="tab-content" rel="#tabs1" id="tabs1" style="display: block;">
                <?php echo $product->summary;?>
            </div>
            <div class="tab-content" rel="#tabs2" id="tabs2">
                <?php echo $product->description;?>
            </div>
            <div class="tab-content" rel="#tabs3" id="tabs3">
                <?php
                if (isset($products_related))
                    echo $products_related;
                ?>
            </div>
        </div>
    </div>
</div>